package com.gzhryc.shared_device.oem.code.member.dao.db;

import com.gzhryc.common.config.DefaultEnum;
import com.gzhryc.jdbc.annotaion.*;
import com.gzhryc.shared_device.oem.code.member.dao.enums.MemberEnum;

import java.io.Serializable;
import java.util.Date;

@NumberBranchTable(keyFieldName = "id")
@Table(name = "member_info")
public class Member implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id(auto = false)
	@Column
	protected Long id;
	
	@Column(length = 32,notNull = true,note="会员昵称，自定义")
	protected String nickname;

	@Column(notNull = true,defVal = "1",note = "会员类型")
	protected Integer type;

	@Column(name = "app_id",note = "微信/支付宝应用ID")
	protected String appId;

	@Column(name = "open_id",length=64,note = "微信/支付宝OpenID")
	protected String openId;

	@Column(name = "face_img", length = 255)
	protected String faceImg;

	@Column(length = 32,note = "用户真实姓名")
	protected String name;

	@Column(notNull = true,defVal = "1",note = "性别")
	protected Integer sex;

	@Column
	protected Date birthday; // 出生日期

	@Column(name = "identity_card_id")
	protected String identityCardId; // 身份证号

	@Column(name = "phone", length = 16, note = "手机号")
	protected String phone;
	
	@Column(notNull = true,defVal = "1")
	protected Integer level;
	
	@Column(name = "last_login_date")
	protected Date lastLoginDate;
	
	@Column(name = "update_date", autoUpdateTime = true)
	protected Date updateDate;

	@Column(name = "create_date")
	protected Date createDate;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getAppId() {
		return appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public String getFaceImg() {
		return faceImg;
	}

	public void setFaceImg(String faceImg) {
		this.faceImg = faceImg;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getIdentityCardId() {
		return identityCardId;
	}

	public void setIdentityCardId(String identityCardId) {
		this.identityCardId = identityCardId;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public Date getLastLoginDate() {
		return lastLoginDate;
	}

	public void setLastLoginDate(Date lastLoginDate) {
		this.lastLoginDate = lastLoginDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getSexName(){
		return DefaultEnum.Sex.note(this.sex);
	}

	public String getTypeName(){
		return MemberEnum.Type.note(this.type);
	}
}
